package vues


import java.awt.Dimension
import javax.swing.ImageIcon
import swing._
import swing.event._
import TabbedPane._

class MyPanel extends GridPanel(1,1) 
	{

    val feature ="Feature non disponible encore"

    var pageTab1:Page =null

    val tabbedPane = new TabbedPane() {
         //val icon = createImageIcon("images/middle.gif")

          val panel1 = new makeTextPanel("Panel #1")

          pageTab1=new Page(
            this, "Processus", panel1,
            "Does nothing")
          {
            //mnemonic = Key.Key1

          }
          pages += pageTab1

         val panel2 = new makeTextPanel(feature)
         pages += new Page(
               this, "Performances", panel2,
              "Does twice as much nothing")
          {
              //mnemonic = Key.Key2
            }

          val panel3 = new makeTextPanel(feature)
          pages += new Page(this, "Mise en réseau", panel3,"Still does nothing")
           {
               //mnemonic = Key.Key3
            }

           val panel4 = new makeTextPanel(feature)
           {
               preferredSize = new Dimension(410, 50)
           }
           pages += new Page(this, "Utilisateurs", panel4,"Does nothing at all")
           {
               //mnemonic = Key.Key4
           }
         }

       //Add the tabbed pane to this panel.
       contents += tabbedPane

       //The following line enables to use scrolling tabs.
       tabbedPane.tabLayoutPolicy = Layout.Scroll

       // ----------------------------------------
       class makeTextPanel(text: String) extends GridPanel(1, 1) {
          val filler = new Label(text) {
               horizontalAlignment = Alignment.Center
             }
           contents += filler
         }

       /** Returns an ImageIcon, or null if the path was invalid. */
       def createImageIcon(path: String): ImageIcon = {
           //val imgURL = TabbedPaneDemo.getClass.getResource(path)
           //if (imgURL != null) {
               //return new ImageIcon(imgURL)
             //} else {
               //System.err.println("Couldn't find file: " + path)
               return null
            //}
         }
     }